home *** CD-ROM | disk | FTP | other *** search
- /**************************************************************************
- * *
- * Copyright (c) 1991 Silicon Graphics, Inc. *
- * All Rights Reserved *
- * *
- * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SGI *
- * *
- * The copyright notice above does not evidence any actual of intended *
- * publication of such source code, and is an unpublished work by Silicon *
- * Graphics, Inc. This material contains CONFIDENTIAL INFORMATION that is *
- * the property of Silicon Graphics, Inc. Any use, duplication or *
- * disclosure not specifically authorized by Silicon Graphics is strictly *
- * prohibited. *
- * *
- * RESTRICTED RIGHTS LEGEND: *
- * *
- * Use, duplication or disclosure by the Government is subject to *
- * restrictions as set forth in subdivision (c)(1)(ii) of the Rights in *
- * Technical Data and Computer Software clause at DFARS 52.227-7013, *
- * and/or in similar or successor clauses in the FAR, DOD or NASA FAR *
- * Supplement. Unpublished - rights reserved under the Copyright Laws of *
- * the United States. Contractor is SILICON GRAPHICS, INC., 2011 N. *
- * Shoreline Blvd., Mountain View, CA 94039-7311 *
- **************************************************************************
- *
- * File: PrintBoxP.h
- *
- * Description: Private include file for the print box GUI.
- *
- **************************************************************************/
-
-
- #ident "$Revision: 1.7 $"
-
-
- #ifndef _PUI_PRINTBOXP_H_
- #define _PUI_PRINTBOXP_H_
-
-
- #include <Xm/BulletinBP.h>
- #include <Sgm/PrintOptionPanel.h>
- #include <Sgm/PrintBox.h>
-
-
- /* No resource specified defaults */
-
- #define DEF_PRINTER NULL
- #define DEF_JOB_TYPE PuiPRINTJOB_FILENAME
- #define DEF_FILENAME NULL
- #define DEF_FD 0
- #define DEF_BUFFER NULL
- #define DEF_BUFSIZE 0
- #define DEF_SHOW_FNAME True
- #define DEF_SHOW_OPTS True
- #define DEF_SHOW_NUMCOPIES True
- #define DEF_SHOW_BANNERTITLE True
- #define DEF_SHOW_COMPLETION True
- #define DEF_SHOW_HANDLING True
- #define DEF_SHOW_PRINTEROPTIONS True
- #define DEF_SHOW_OPTIONSBUTTON True
- #define DEF_SHOW_SAVEBUTTON True
- #define DEF_VIS_COUNT 8
- #define DEF_PRINT_POLICY PuiWIDGET_PRINTING
- #define DEF_BUTTON_PLACEMENT PuiBUTTONS_CENTER
- #define DEF_BUTTON_SPACING 8
- #define DEF_INSENSITIVE_FORE "black"
- #define DEF_INSENSITIVE_BACK "SGILightGrey"
- #define DEF_PRINTER_FONT "-*-screen-medium-r-normal-*-15*"
- #define DEF_DEFAULT_PRINTER_FONT "-*-screen-bold-r-normal-*-15*"
- #define DEF_BUSY_CURSOR "watch"
- /* Labels */
- #define DEF_PRINTB_LABEL "Print"
- #define DEF_USER1B_LABEL "User1"
- #define DEF_USER2B_LABEL "User2"
- #define DEF_USER3B_LABEL "User3"
- #define DEF_USER4B_LABEL "User4"
- #define DEF_OPTIONSB_LABEL "More Options..."
- #define DEF_SAVEB_LABEL "Save Options..."
- #define DEF_CANCELB_LABEL "Cancel"
- #define DEF_HELPB_LABEL "Help"
- #define DEF_FILES_LABEL "Files to print:"
- #define DEF_PLIST_LABEL "Available printers:"
- #define DEF_OPTS_LABEL "Options:"
- #define DEF_NUMCOPIES_LABEL "Number of copies:"
- #define DEF_JOBTITLE_LABEL "Banner page title:"
- #define DEF_DEFTITLE_LABEL "Default"
- #define DEF_SPECTITLE_LABEL "Custom:"
- #define DEF_COMPLETION_LABEL "When job is complete:"
- #define DEF_MAIL_LABEL "Send mail"
- #define DEF_MESSAGE_LABEL "Send message to console"
- #define DEF_HANDLING_LABEL "Print file handling:"
- #define DEF_COPY_LABEL "Copy to spool directory"
- #define DEF_LINK_LABEL "Link in spool directory"
- #define DEF_PRINTERSPEC_LABEL "Printer-specific options:"
- #define DEF_SAVEDLGTITLE_LABEL "Save Settings"
- #define DEF_SAVEDLGSAVE_LABEL "Save"
- #define DEF_SAVEDLGUSER_LABEL "Save - Personal"
- #define DEF_SAVEDLGALL_LABEL "Save - All Users"
- #define DEF_SAVEDLGCANCEL_LABEL "Cancel"
- #define DEF_SAVEDLGMSG_LABEL "Save spooler settings.\n\n" \
- "In addition, save printer specific settings for:"
-
- /* Options */
- #define DEF_NUM_COPIES 1
- #define DEF_COPY False
- #define DEF_MAIL False
- #define DEF_MESSAGE False
- #define DEF_JOB_TITLE NULL
- #define DEF_SPEC_OPTS NULL
-
-
- /* UI layout constants */
-
- #define LABEL_FIELD_SPACE 4
- #define NUM_COPIES_COLS 3
- #define OPTS_INDENT 30
- #define SPEC_OPTS_COLS 25
- #define JOB_TITLE_COLS 15
- #define TEXT_FIELD_MAR 2
- #define ARROW_WIDTH 17
-
-
- /* Type-in field illegal characters */
-
- #define TYPEIN_BAD_CHARS "><&;|\"'`()^"
-
-
- /* Character set name for default printer font */
-
- #define PRINTER_CHARSET "printerCharset"
- #define DEF_PRINTER_CHARSET "defPrinterCharset"
-
-
- /* Text field color info */
-
- typedef struct _PuiPrintBoxFieldColors {
- Pixel foreground; /* Text field foreground color */
- Pixel background; /* Text field background color */
- Pixel tshadow; /* Top shadow color */
- Pixel bshadow; /* Bottom shadow color */
- } PuiPrintBoxFieldColors;
-
-
- /* Printer specific options structure */
-
- typedef struct _PuiPrinterOption {
- Boolean modified; /* Indicates if option string has changed */
- char *option_str; /* Printer specific option string */
- } PuiPrinterOption;
-
-
- /* Class part and record structures */
-
- typedef struct _PuiPrintBoxClassPart {
- int dummy; /* Just to keep compiler happy */
- } PuiPrintBoxClassPart;
-
- typedef struct _PuiPrintBoxClassRec {
- CoreClassPart core_class;
- CompositeClassPart composite_class;
- ConstraintClassPart constraint_class;
- XmManagerClassPart manager_class;
- XmBulletinBoardClassPart bulletin_board_class;
- PuiPrintBoxClassPart puiPrintBox_class;
- } PuiPrintBoxClassRec;
-
-
- /* Instance part and record structures */
-
- typedef struct _PuiPrintBoxPart {
- /* Public - General Resources */
- int res_num_printers; /* Num printers available (read-only) */
- SLPrinterStruct *res_printer_list; /* Available printers (read-only) */
- char *res_default_printer; /* System default printer (read-only) */
- char *res_printer; /* Printer specified as resource */
- int res_job_type; /* Print job type (eg. filename) */
- char *res_filename; /* Print file specified as resource */
- int res_fd; /* Print job file descriptor */
- XtPointer res_buffer; /* Print job buffer */
- int res_bufsize; /* Number of bytes in buffer */
- int res_print_policy; /* Whether widget or app prints */
- Boolean res_show_fname; /* Show filename entry field */
- Boolean res_show_opts; /* Show options */
- Boolean res_show_numcopies; /* Show number of copies option */
- Boolean res_show_bannertitle; /* Show banner title option */
- Boolean res_show_completion; /* Show job completion notify option */
- Boolean res_show_handling; /* Show job handling option */
- Boolean res_show_printeroptions; /* Show printer specific options */
- Boolean res_show_optionsbutton; /* Show Options button */
- Boolean res_show_savebutton; /* Show Save button */
- Boolean res_filename_sensitive; /* Filename field sensitivity */
- Boolean res_numcopies_sensitive; /* Number copies field sensitivity */
- Boolean res_poptions_sensitive; /* Printer options field sensitivity */
- int res_button_placement; /* Action area button placement */
- int res_button_spacing; /* Action area button horiz. spacing */
- int res_vis_count; /* Printer list visible item count */
- XFontStruct *res_printer_font; /* Font for printer list */
- XFontStruct *res_def_printer_font; /* Font for default printer */
- Cursor res_busy_cursor; /* Busy cursor for option panel exec */
- /* Public - Labels */
- XmString res_printb_label; /* Print button label string */
- XmString res_user1b_label; /* User defined button 1 label string */
- XmString res_user2b_label; /* User defined button 2 label string */
- XmString res_user3b_label; /* User defined button 3 label string */
- XmString res_user4b_label; /* User defined button 4 label string */
- XmString res_optionsb_label; /* Options button label string */
- XmString res_saveb_label; /* Save button label string */
- XmString res_cancelb_label; /* Cancel button label string */
- XmString res_helpb_label; /* Help button label string */
- XmString res_files_label; /* File entry field label string */
- XmString res_plist_label; /* Printer selection label string */
- XmString res_opts_label; /* Option area label string */
- XmString res_numcopies_label; /* Number of copies label string */
- XmString res_title_label; /* Banner page title label string */
- XmString res_deftitle_label; /* Default title label string */
- XmString res_spectitle_label; /* Specify title label string */
- XmString res_complete_label; /* Job completion label string */
- XmString res_complete_mail_label; /* Mail on completion label string */
- XmString res_complete_mess_label; /* Message on complete label string */
- XmString res_handling_label; /* Job handling label string */
- XmString res_handling_copy_label; /* Copy job label string */
- XmString res_handling_link_label; /* Link job label string */
- XmString res_spec_options_label; /* Printer specific options label */
- XmString res_savedlg_title_label; /* Save dialog title label */
- XmString res_savedlg_saveb_label; /* Save dialog save button label */
- XmString res_savedlg_userb_label; /* Save dialog user save button label */
- XmString res_savedlg_allb_label; /* Save dialog all save button label */
- XmString res_savedlg_cancelb_label; /* Save dialog cancel button label */
- XmString res_savedlg_msg_label; /* Save dialog message label */
- /* Public - Callbacks */
- XtCallbackList res_print_callback; /* Print button callback list */
- XtCallbackList res_user1_callback; /* User button 1 callback list */
- XtCallbackList res_user2_callback; /* User button 2 callback list */
- XtCallbackList res_user3_callback; /* User button 3 callback list */
- XtCallbackList res_user4_callback; /* User button 4 callback list */
- XtCallbackList res_save_callback; /* Save button callback list */
- XtCallbackList res_cancel_callback; /* Cancel button callback list */
- XtCallbackList res_help_callback; /* Help button callback list */
- XtCallbackList res_jobinfo_callback;/* Print job information callback */
- XtCallbackList res_pr_select_callback; /* Printer selection callback */
- XtCallbackList res_pr_action_callback; /* Printer action callback */
- XtCallbackList res_error_callback; /* Libspool error callback */
- XtCallbackList res_opt_error_callback; /* Option panel error callback */
-
- /* Public - Option resources */
- /* Number of copies */
- int res_numcopies;
- /* Banner page */
- char *res_job_title;
- /* Job completion */
- Boolean res_mail;
- Boolean res_message;
- /* Print file handling */
- Boolean res_copy;
- /* Printer specific options */
- char *res_spec_opts;
-
- /* Private - State */
- Widget work_area; /* User defineable work area */
- Widget pf_form; /* Filename and printer list form */
- Widget option_form; /* Job option area form */
- Widget separator; /* Action area separator */
- Widget action_form; /* Action area form */
-
- Widget printb_widget; /* Print button widget ID */
- Widget user1b_widget; /* User defined button 1 ID */
- Widget user2b_widget; /* User defined button 2 ID */
- Widget user3b_widget; /* User defined button 3 ID */
- Widget user4b_widget; /* User defined button 4 ID */
- Widget optionsb_widget; /* Options button widget ID */
- Widget saveb_widget; /* Save button widget ID */
- Widget cancelb_widget; /* Cancel button widget ID */
- Widget helpb_widget; /* Help button widget ID */
- Widget files_label_widget; /* File list text field label */
- Widget plist_label_widget; /* Printer list label */
- Widget opts_label_widget; /* Options list label */
- Widget numcopies_label_widget; /* Number of copies label */
- Widget title_label_widget; /* Banner page title label */
- Widget complete_label_widget; /* Job completion label */
- Widget handling_label_widget; /* Job handling label */
- Widget spec_options_label_widget; /* Printer specific options label */
- Widget files_widget; /* File list text field */
- Widget plist_widget; /* Printer list widget */
- Widget action_rc; /* Action area button row column */
- Widget opts_rc_widget; /* Options row/col widget */
- Widget opts_sw_widget; /* Options scrolled window */
- Widget save_dialog_widget; /* Options save dialog widget */
- Widget save_list_widget; /* Save dialog's list widget */
- Widget save_msg_widget; /* Save dialog's message lbl widget */
- int selected_printer_index; /* Index of selected printer (0 base) */
- Boolean adding_pb_widgets; /* Indicates who is adding children */
- PuiPrintBoxFieldColors tfield_sensitive; /* Field sensitive colors */
- PuiPrintBoxFieldColors tfield_insensitive; /* Field insensitive colors */
- char *user_name; /* User's login name */
- PuiPrinterOption *printer_options; /* Printer specific options array */
- int init_error_code; /* Initialization error code */
- PuiOptionPanel **option_panels; /* Array of option panels */
-
- /* Private - Job submittal settings */
- int num_copies; /* Number of copies */
- int copy_file; /* Print file handling */
- int mail; /* Completion notification */
- char *job_title; /* Print job title */
- char *options; /* Spooler specific options */
-
- /* Private - Print option state */
- /* Number of copies */
- Widget numcopies_text_widget;
- /* Banner page */
- Widget banner_deftitle_widget;
- Widget banner_spectitle_widget;
- Widget banner_select_widget;
- Widget banner_text_widget;
- /* Job completion */
- Widget complete_mail_widget;
- Widget complete_mess_widget;
- /* Print file handling */
- Widget handling_link_widget;
- Widget handling_copy_widget;
- /* Printer specific options */
- Widget spec_options_widget;
- } PuiPrintBoxPart;
-
- typedef struct _PuiPrintBoxRec {
- CorePart core;
- CompositePart composite;
- ConstraintPart constraint;
- XmManagerPart manager;
- XmBulletinBoardPart bulletin_board;
- PuiPrintBoxPart printBox;
- } PuiPrintBoxRec;
-
-
- /* Printing options structure */
-
- typedef struct _PuiPrintBoxOption {
- void (*create_func)(PuiPrintBoxPart*, Widget);
- void (*set_func)(PuiPrintBoxPart*);
- void (*get_func)(PuiPrintBoxPart*);
- void (*syn_get_func)(Widget, int, XtArgVal*);
- } PuiPrintBoxOption;
-
-
- #endif /* _PUI_PRINTBOXP_H_ */
-